if exists (select * from dbo.sysobjects where id = object_id(N'dbo.ChangeTransaction') and OBJECTPROPERTY(id, N'IsTable') = 1)
drop table dbo.ChangeTransaction

GO

create table dbo.ChangeTransaction
(
	ID bigint identity(1,1) CONSTRAINT PkChangeTransaction_ID PRIMARY KEY CLUSTERED,
	TableName varchar(128) not null,
	UserName varchar(50) not null
		DEFAULT substring(SYSTEM_USER, 1, 50),
	HostName varchar(50) not null
		DEFAULT substring(HOST_NAME(), 1, 50),
	AppName varchar(100) not null
		DEFAULT substring(APP_NAME(), 1, 100),
	ChangeDate datetime not null
		DEFAULT getdate(),
	Spid int not null
		DEFAULT @@SPID
)

GO

exec sp_addextendedproperty 'CdcDbType', 'CdcStaging', NULL, NULL, NULL, NULL